import service from '../utils/request.js'

// 添加角色信息
export const  mockRoleMan=(roleName,roleDesc)=>{
    return service({
        method:'post',
        url:'/api/roleInfo',
        data:{
            roleName,
            roleDesc
        }
    })
}

//修改角色信息
 export const mockPutRoleMan=(roleName,roleDesc)=>{
    return service({
        method:'put',
        url:'/api/roleInfo',
        data:{
            roleName,
            roleDesc
        },
    })
 }

//获取角色列表信息


export const mockRoleManList=(currentPages,pageSize)=>{
    return service({
        url:'/api/roleInfo',
        method:'get',
        params:{
            currentPages,
            pageSize
        }
    })
}

//删除角色名称

export const mockDeleteRoleMan=(roleName)=>{
    return service({
        method:'delete',
        url:`/api/roleInfo/${roleName}`,
        data:{
            roleName
        }
    })
}


//添加权限信息
export const mockRoleManInfo=(RoleId,NodeId,RoleRightId)=>{
    return service({
        method:'post',
        url:`/api/roleInfo/v1/admin/permissions/${RoleId}`,
        data:{
            RoleId,
            RoleRightId,
            NodeId
        }
    })
}


//登录日志查询
export const  getLoginLogList=(endTime,currentPage,pageSize,beginTime)=>{
    return service({
        method:'get',
        url:'/api/loginLog',
        params:{
            endTime,
            currentPage,
            pageSize,
            beginTime
        }
        
    })
}

//登录日志删除
export const  deleteLoginLogList=(loginId)=>{
    return service({
        method:'delete',
        url:'/api/loginLog',
        params:{
            loginId
        }
        
    })
}